package com.chinacoal.hr.levelimpl.controller;

import com.chinacoal.hr.levelapi.client.AttendanceTaskClient;
import com.chinacoal.hr.levelapi.client.response.Result;
import com.chinacoal.hr.levelapi.client.response.ResultGenerator;
import com.chinacoal.hr.levelimpl.service.AttendanceTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author: YunTao.Li
 * @create: 2020-06-07 10:38
 * @description:
 **/
@RestController
public class AttendanceTaskController implements AttendanceTaskClient{

    @Autowired
    private AttendanceTaskService attendanceTaskService;

    /**
     * 获得任务的详情数据
     *
     * @param bizCode :
     * @param bizID   :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2020/6/7 2020/6/7
     */

    public Result getTaskInfo(String bizCode, String bizID) {
        Map<String, String> record = null;
        try {
            record = attendanceTaskService.getAttendanceTaskInfo(bizID, bizCode);
        } catch (Throwable e) {
            ResultGenerator.genFailedResult(e.getMessage());
        }
        return ResultGenerator.genOkResult(record);
    }
}
